<template>
    <div class="tabs-bar-wrapper">
        <div class="tabs-bar">
            <ul class="tabs-nav">
                <router-link @click.native="changeb" active-class="active tab-ink-bar" to="/Film/Nowplaying" tag="li" style="width: 50%;">
                     <span>正在热映</span>
                </router-link>
                <router-link @click.native="change"  active-class="active" to="/Film/Comingsoon" tag="li" style="width: 50%;">
                     <span>抢票占座</span>
                </router-link>

                <div  class="tab-ink-bar-wrapper" :style="Nowplaying">
                    <span class="tab-ink-bar" style="width: 56px;"></span>
                </div>
            </ul>
        </div>
    </div>
</template>
<style scoped>
.tabs-bar-wrapper {
    position:sticky;
    top:0;
    z-index: 100;
    width: 100%;
    overflow-x: hidden;
    background: #fff;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}
div {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}
.tabs-bar-wrapper .tabs-bar {
    height: 49px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    -webkit-transition: -webkit-transform .2s cubic-bezier(.35,0,.25,1);
    transition: -webkit-transform .2s cubic-bezier(.35,0,.25,1);
    -o-transition: transform .2s cubic-bezier(.35,0,.25,1);
    transition: transform .2s cubic-bezier(.35,0,.25,1);
    transition: transform .2s cubic-bezier(.35,0,.25,1),-webkit-transform .2s cubic-bezier(.35,0,.25,1);
    position: relative;
}
.tabs-bar-wrapper .tabs-bar .tabs-nav {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    display: -webkit-flex;
    -webkit-box-pack: start;
    -ms-flex-pack: start;
    justify-content: flex-start;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    position: relative;
    width: 100%;
}
.tabs-bar-wrapper li, .tabs-bar-wrapper ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.tabs-bar-wrapper .tabs-bar .tabs-nav li.active {
    color: #ff5f16;
}
.tabs-bar-wrapper .tabs-bar .tabs-nav .tab-ink-bar-wrapper .tab-ink-bar {
    border-bottom: 2px solid #ff5f16;
    border-radius: 20px;
    display: block;
    margin: auto;
}
.tabs-bar-wrapper .tabs-bar .tabs-nav li {
    -ms-flex-negative: 0;
    flex-shrink: 0;
    -webkit-flex-shrink: 0;
    color: #191a1b;
    text-align: center;
    height: 16px;
    line-height: 16px;
    font-size: 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}
.tabs-bar-wrapper .tabs-bar .tabs-nav .tab-ink-bar-wrapper {
    position: absolute;
    margin: auto;
    top: 30px;
    left: 0;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-transition: -webkit-transform .2s cubic-bezier(.35,0,.25,1);
    transition: -webkit-transform .2s cubic-bezier(.35,0,.25,1);
    -o-transition: transform .2s cubic-bezier(.35,0,.25,1);
    transition: transform .2s cubic-bezier(.35,0,.25,1);
    transition: transform .2s cubic-bezier(.35,0,.25,1),-webkit-transform .2s cubic-bezier(.35,0,.25,1);
}
.tabs-bar-wrapper .tabs-bar .tabs-nav .tab-ink-bar-wrapper {
    position: absolute;
    margin: auto;
    top: 30px;
    left: 0;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-transition: -webkit-transform .2s cubic-bezier(.35,0,.25,1);
    transition: -webkit-transform .2s cubic-bezier(.35,0,.25,1);
    -o-transition: transform .2s cubic-bezier(.35,0,.25,1);
    transition: transform .2s cubic-bezier(.35,0,.25,1);
    transition: transform .2s cubic-bezier(.35,0,.25,1),-webkit-transform .2s cubic-bezier(.35,0,.25,1);
}
.tabs-bar-wrapper .tabs-bar:after {
    content: " ";
    position: absolute;
    left: 0;
    bottom: 0;
    right: 0;
    height: 1px;
    border-bottom: 1px solid #ededed;
    color: #ededed;
    -webkit-transform-origin: 0 100%;
    -ms-transform-origin: 0 100%;
    transform-origin: 0 100%;
    -webkit-transform: scaleY(.5);
    -ms-transform: scaleY(.5);
    transform: scaleY(.5);
}
.tabs-bar-wrapper .tabs-bar .tabs-nav .tab-ink-bar-wrapper .tab-ink-bar {
    border-bottom: 2px solid #ff5f16;
    border-radius: 20px;
    display: block;
    margin: auto;
}
</style>
<script>
export default {
  data () {
    return {
      Nowplaying: 'transform: translate3d(0%, 0px, 0px); width: 50%;'
    }
  },
  mounted () {

  },
  methods: {
    change () {
      this.Nowplaying = 'transform: translate3d(100%, 0px, 0px); width: 50%;'
    },
    changeb () {
      this.Nowplaying = 'transform: translate3d(0%, 0px, 0px); width: 50%;'
    }
  }
}
</script>
